declare const window: any

import { App } from 'vue'
import {
  // PageFrame,
  // PageFooter,
  // PageTab,
  // PageSearch,
  // PageLineText,
  // AppIframe,
  Chart,
  MenuCheck
} from '@/importComponents'

const install = function (app: App, options: any = {}) {
  // 注册全局组件
  // app.component('page-frame', PageFrame)

  // app.component('page-footer', PageFooter)
  // app.component('page-tab', PageTab)
  // app.component('page-search', PageSearch)
  // app.component('page-line-text', PageLineText)
  // app.component('app-iframe', AppIframe)
  app.component('chart', Chart)
  app.component('menu-check', MenuCheck)


  /**
   * 添加全局的 后退事件
   */
  app.config.globalProperties.goBack = function (isBackReload: Boolean) {
    if (isBackReload) {
      setTimeout(() => {
        window.location.reload()
      }, 300)
    }
    window.history.go(-1)
  }
}

/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  install
}
